package com.company.cloud.mall.modules.app.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.company.cloud.common.bean.LoginSimpleUserInfo;
import com.company.cloud.common.constant.BaseConstant.YNEnum;
import com.company.cloud.mall.modules.api.response.OrderModel;
import com.company.cloud.mall.modules.app.controller.req.*;
import com.company.cloud.mall.modules.base.entity.OrderInfo;
import com.company.cloud.mall.modules.mgr.controller.req.OrderMgrQuery4PageParam;
import com.company.cloud.mall.modules.mgr.controller.req.OrderSendParam;

import java.util.List;

public interface ShopOrderService {


    /**
     * 用户查询订单
     */
    public IPage<OrderModel> queryUserOrders(OrderQuery4PageParam params, LoginSimpleUserInfo userInfo);

    /**
     * 管理员查询订单
     */
    public IPage<OrderModel> queryOrders(OrderMgrQuery4PageParam params, LoginSimpleUserInfo userInfo);

    /**
     * 订单明细
     *
     * @param sn:订单号
     * @param isCompany:是否显示商户信息
     * @param isUser:是否显示用户信息
     * @param isPay:是否显示支付信息
     * @param isSend:是否显示发货信息
     * @param isAfter:是否显示售后信息
     */
    public OrderModel getOrder(String sn, boolean isCompany, boolean isUser, boolean isPay, boolean isSend, boolean isAfter);

    /**
     * 订单明细
     *
     * @param sn:订单号
     * @param itemId:订单明细
     * @param isCompany:是否显示商户信息
     * @param isUser:是否显示用户信息
     * @param isPay:是否显示支付信息
     * @param isSend:是否显示发货信息
     * @param isAfter:是否显示售后信息
     */
    public OrderModel getOrder(String sn, Integer itemId, boolean isCompany, boolean isUser,
                               boolean isPay, boolean isSend, boolean isAfter);

    /**
     * 新增订单-单商户订单
     */
    public OrderInfo saveOrderByCustSingle(Integer userId, Integer referralUserId, String referralCode,
                                           OrderSaveItem params, LoginSimpleUserInfo userInfo);

    /**
     * 新增订单-多商户订单
     */
    public List<OrderInfo> saveOrderByCustMultiple(Integer userId, Integer referralUserId, String referralCode,
                                                   OrderSaveParam params, LoginSimpleUserInfo userInfo);

    /**
     * 新增订单-单商品订单
     */
    public OrderInfo saveOrderByProductSingle(Integer userId, Integer referralUserId,
                                              String referralCode, OrderByProductSingleSaveParam params, LoginSimpleUserInfo userInfo);


    /**
     * 关闭
     */
    public void close(String sn, LoginSimpleUserInfo userInfo);

    /**
     * 审核
     */
    public void check(String sn, YNEnum state, LoginSimpleUserInfo userInfo);

    /**
     * 发货(配送)
     */
    public void send(OrderSendParam params, LoginSimpleUserInfo userInfo);

    /**
     * 完成(确认收货)
     */
    public void complete(String sn, LoginSimpleUserInfo userInfo);

    /**
     * 完成
     */
    public void completeByTask(OrderInfo order, LoginSimpleUserInfo userInfo);

    /**
     * 发货(自提/到店)
     */
    public void send(OrderExchangeParam params, LoginSimpleUserInfo userInfo);

    /**
     * 发货(核销)
     */
    public void checkTicket(OrderTicketCodeCheckParam params, LoginSimpleUserInfo userInfo);

    /**
     * 兑换积分
     */
    public void exchangePoint(String sn, LoginSimpleUserInfo userInfo);

    /**
     * 用户删除订单
     */
    public void removeByUser(String sn, LoginSimpleUserInfo userInfo);

    /**
     * 关闭任务
     */
    public void closeTask();


}
